using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_pickticketMap : EntityTypeConfiguration<so_pickticket>
    {
        public so_pickticketMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.Ticket__)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.AGENT)
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.DATE_OF_ISSUE)
                .IsFixedLength()
                .HasMaxLength(7);

            this.Property(t => t.ISSUE_BY)
                .IsFixedLength()
                .HasMaxLength(24);

            this.Property(t => t.NUMBER_OF_TICKET_BOOKS)
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.passenger_name)
                .IsFixedLength()
                .HasMaxLength(33);

            this.Property(t => t.NAME_FIELD_REMARKS)
                .IsFixedLength()
                .HasMaxLength(33);

            this.Property(t => t.SECOND_LINE_OF_FARE)
                .IsFixedLength()
                .HasMaxLength(61);

            this.Property(t => t.CURRENCY)
                .IsFixedLength()
                .HasMaxLength(3);

            this.Property(t => t.CASH_COLLECTION)
                .IsFixedLength()
                .HasMaxLength(12);

            this.Property(t => t.TOUR_CODE)
                .IsFixedLength()
                .HasMaxLength(20);

            this.Property(t => t.TOTAL_AMOUNT)
                .IsFixedLength()
                .HasMaxLength(12);

            this.Property(t => t.CURRENCY_FOR_TAXES)
                .IsFixedLength()
                .HasMaxLength(3);

            this.Property(t => t.TAX_1)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.TAX_1_TAX_CODE)
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.TAX_2)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.TAX_2_TAX_CODE)
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.TAX_3)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.TAX_3_TAX_CODE)
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("so_pickticket");
            this.Property(t => t.Ticket__).HasColumnName("Ticket_#");
            this.Property(t => t.AGENT).HasColumnName("AGENT");
            this.Property(t => t.DATE_OF_ISSUE).HasColumnName("DATE_OF_ISSUE");
            this.Property(t => t.ISSUE_BY).HasColumnName("ISSUE_BY");
            this.Property(t => t.COMM_RATE).HasColumnName("COMM_RATE");
            this.Property(t => t.NUMBER_OF_TICKET_BOOKS).HasColumnName("NUMBER_OF_TICKET_BOOKS");
            this.Property(t => t.passenger_name).HasColumnName("passenger name");
            this.Property(t => t.NAME_FIELD_REMARKS).HasColumnName("NAME_FIELD_REMARKS");
            this.Property(t => t.SECOND_LINE_OF_FARE).HasColumnName("SECOND_LINE_OF_FARE");
            this.Property(t => t.CURRENCY).HasColumnName("CURRENCY");
            this.Property(t => t.CASH_COLLECTION).HasColumnName("CASH_COLLECTION");
            this.Property(t => t.TOUR_CODE).HasColumnName("TOUR_CODE");
            this.Property(t => t.TOTAL_AMOUNT).HasColumnName("TOTAL_AMOUNT");
            this.Property(t => t.CURRENCY_FOR_TAXES).HasColumnName("CURRENCY_FOR_TAXES");
            this.Property(t => t.TAX_1).HasColumnName("TAX_1");
            this.Property(t => t.TAX_1_TAX_CODE).HasColumnName("TAX_1_TAX_CODE");
            this.Property(t => t.TAX_2).HasColumnName("TAX_2");
            this.Property(t => t.TAX_2_TAX_CODE).HasColumnName("TAX_2_TAX_CODE");
            this.Property(t => t.TAX_3).HasColumnName("TAX_3");
            this.Property(t => t.TAX_3_TAX_CODE).HasColumnName("TAX_3_TAX_CODE");
            this.Property(t => t.id).HasColumnName("id");
        }
    }
}
